Integrand size = 33, antiderivative size = 91 \[ \int \frac {\left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx=-\frac {2 A \text {arctanh}(\sin (c+d x))}{a^2 d}+\frac {(10 A+C) \tan (c+d x)}{3 a^2 d}-\frac {2 A \tan (c+d x)}{a^2 d (1+\cos (c+d x))}-\frac {(A+C) \tan (c+d x)}{3 d (a+a \cos (c+d x))^2} \]
-2*A*arctanh(sin(d*x+c))/a^2/d+1/3*(10*A+C)*tan(d*x+c)/a^2/d-2*A*tan(d*x+c )/a^2/d/(1+cos(d*x+c))-1/3*(A+C)*tan(d*x+c)/d/(a+a*cos(d*x+c))^2
Leaf count is larger than twice the leaf count of optimal. \(288\) vs. \(2(91)=182\).
Time = 1.55 (sec) , antiderivative size = 288, normalized size of antiderivative = 3.16 \[ \int \frac {\left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx=\frac {4 \cos \left (\frac {1}{2} (c+d x)\right ) \cos ^2(c+d x) \left (C+A \sec ^2(c+d x)\right ) \left ((A+C) \sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right )+2 (7 A+C) \cos ^2\left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right )+6 A \cos ^3\left (\frac {1}{2} (c+d x)\right ) \left (2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {\sin (d x)}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )+(A+C) \cos \left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {c}{2}\right )\right )}{3 a^2 d (1+\cos (c+d x))^2 (2 A+C+C \cos (2 (c+d x)))} \]
(4*Cos[(c + d*x)/2]*Cos[c + d*x]^2*(C + A*Sec[c + d*x]^2)*((A + C)*Sec[c/2 ]*Sin[(d*x)/2] + 2*(7*A + C)*Cos[(c + d*x)/2]^2*Sec[c/2]*Sin[(d*x)/2] + 6* A*Cos[(c + d*x)/2]^3*(2*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - 2*Log[C os[(c + d*x)/2] + Sin[(c + d*x)/2]] + Sin[d*x]/((Cos[c/2] - Sin[c/2])*(Cos [c/2] + Sin[c/2])*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2]))) + (A + C)*Cos[(c + d*x)/2]*Tan[c/2]))/(3*a^2*d*(1 + Cos[c + d*x])^2*(2*A + C + C*Cos[2*(c + d*x)]))
Time = 0.75 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.08, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.303, Rules used = {3042, 3521, 3042, 3457, 3042, 3227, 3042, 4254, 24, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sec ^2(c+d x) \left (A+C \cos ^2(c+d x)\right )}{(a \cos (c+d x)+a)^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+C \sin \left (c+d x+\frac {\pi }{2}\right )^2}{\sin \left (c+d x+\frac {\pi }{2}\right )^2 \left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right )^2}dx\) |
\(\Big \downarrow \) 3521 |
\(\displaystyle \frac {\int \frac {(a (4 A+C)-a (2 A-C) \cos (c+d x)) \sec ^2(c+d x)}{\cos (c+d x) a+a}dx}{3 a^2}-\frac {(A+C) \tan (c+d x)}{3 d (a \cos (c+d x)+a)^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a (4 A+C)-a (2 A-C) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^2 \left (\sin \left (c+d x+\frac {\pi }{2}\right ) a+a\right )}dx}{3 a^2}-\frac {(A+C) \tan (c+d x)}{3 d (a \cos (c+d x)+a)^2}\) |
\(\Big \downarrow \) 3457 |
\(\displaystyle \frac {\frac {\int \left (a^2 (10 A+C)-6 a^2 A \cos (c+d x)\right ) \sec ^2(c+d x)dx}{a^2}-\frac {6 A \tan (c+d x)}{d (\cos (c+d x)+1)}}{3 a^2}-\frac {(A+C) \tan (c+d x)}{3 d (a \cos (c+d x)+a)^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {\int \frac {a^2 (10 A+C)-6 a^2 A \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^2}dx}{a^2}-\frac {6 A \tan (c+d x)}{d (\cos (c+d x)+1)}}{3 a^2}-\frac {(A+C) \tan (c+d x)}{3 d (a \cos (c+d x)+a)^2}\) |
\(\Big \downarrow \) 3227 |
\(\displaystyle \frac {\frac {a^2 (10 A+C) \int \sec ^2(c+d x)dx-6 a^2 A \int \sec (c+d x)dx}{a^2}-\frac {6 A \tan (c+d x)}{d (\cos (c+d x)+1)}}{3 a^2}-\frac {(A+C) \tan (c+d x)}{3 d (a \cos (c+d x)+a)^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {a^2 (10 A+C) \int \csc \left (c+d x+\frac {\pi }{2}\right )^2dx-6 a^2 A \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{a^2}-\frac {6 A \tan (c+d x)}{d (\cos (c+d x)+1)}}{3 a^2}-\frac {(A+C) \tan (c+d x)}{3 d (a \cos (c+d x)+a)^2}\) |
\(\Big \downarrow \) 4254 |
\(\displaystyle \frac {\frac {-\frac {a^2 (10 A+C) \int 1d(-\tan (c+d x))}{d}-6 a^2 A \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{a^2}-\frac {6 A \tan (c+d x)}{d (\cos (c+d x)+1)}}{3 a^2}-\frac {(A+C) \tan (c+d x)}{3 d (a \cos (c+d x)+a)^2}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {\frac {\frac {a^2 (10 A+C) \tan (c+d x)}{d}-6 a^2 A \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{a^2}-\frac {6 A \tan (c+d x)}{d (\cos (c+d x)+1)}}{3 a^2}-\frac {(A+C) \tan (c+d x)}{3 d (a \cos (c+d x)+a)^2}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {\frac {\frac {a^2 (10 A+C) \tan (c+d x)}{d}-\frac {6 a^2 A \text {arctanh}(\sin (c+d x))}{d}}{a^2}-\frac {6 A \tan (c+d x)}{d (\cos (c+d x)+1)}}{3 a^2}-\frac {(A+C) \tan (c+d x)}{3 d (a \cos (c+d x)+a)^2}\) |
-1/3*((A + C)*Tan[c + d*x])/(d*(a + a*Cos[c + d*x])^2) + ((-6*A*Tan[c + d* x])/(d*(1 + Cos[c + d*x])) + ((-6*a^2*A*ArcTanh[Sin[c + d*x]])/d + (a^2*(1 0*A + C)*Tan[c + d*x])/d)/a^2)/(3*a^2)
3.1.53.3.1 Defintions of rubi rules used
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[c Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b Int [(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim p[b*(A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^( n + 1)/(a*f*(2*m + 1)*(b*c - a*d))), x] + Simp[1/(a*(2*m + 1)*(b*c - a*d)) Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[B*(a*c*m + b *d*(n + 1)) + A*(b*c*(m + 1) - a*d*(2*m + n + 2)) + d*(A*b - a*B)*(m + n + 2)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ [b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[m, -2^(-1)] && !GtQ[n, 0] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c, 0])
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[a*(A + C)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^(n + 1)/(f*(b*c - a*d)*(2*m + 1))), x] + Simp[1/(b*(b*c - a*d)*(2*m + 1)) I nt[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[A*(a*c*(m + 1) - b*d*(2*m + n + 2)) - C*(a*c*m + b*d*(n + 1)) + (a*A*d*(m + n + 2) + C*(b* c*(2*m + 1) - a*d*(m - n - 1)))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, C, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[m, -2^(-1)]
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 2.41 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.30
method | result | size |
parallelrisch | \(\frac {24 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \cos \left (d x +c \right )-24 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \cos \left (d x +c \right )+28 \left (\left (\frac {5 A}{14}+\frac {C}{28}\right ) \cos \left (2 d x +2 c \right )+\left (A +\frac {C}{7}\right ) \cos \left (d x +c \right )+\frac {4 A}{7}+\frac {C}{28}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d \,a^{2} \cos \left (d x +c \right )}\) | \(118\) |
derivativedivides | \(\frac {\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{3}+\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{3}+5 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C -\frac {2 A}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+4 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\frac {2 A}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}-4 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d \,a^{2}}\) | \(123\) |
default | \(\frac {\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{3}+\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{3}+5 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C -\frac {2 A}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+4 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\frac {2 A}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}-4 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d \,a^{2}}\) | \(123\) |
risch | \(\frac {2 i \left (6 A \,{\mathrm e}^{4 i \left (d x +c \right )}+18 A \,{\mathrm e}^{3 i \left (d x +c \right )}+3 C \,{\mathrm e}^{3 i \left (d x +c \right )}+22 A \,{\mathrm e}^{2 i \left (d x +c \right )}+C \,{\mathrm e}^{2 i \left (d x +c \right )}+24 A \,{\mathrm e}^{i \left (d x +c \right )}+3 C \,{\mathrm e}^{i \left (d x +c \right )}+10 A +C \right )}{3 d \,a^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{3} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {2 A \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{a^{2} d}-\frac {2 A \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{a^{2} d}\) | \(169\) |
norman | \(\frac {\frac {\left (A +C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 a d}+\frac {\left (A +C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a d}+\frac {2 \left (4 A +C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 a d}-\frac {\left (9 A +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a d}-\frac {2 \left (10 A +C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a}+\frac {2 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a^{2} d}-\frac {2 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a^{2} d}\) | \(193\) |
1/12*(24*A*ln(tan(1/2*d*x+1/2*c)-1)*cos(d*x+c)-24*A*ln(tan(1/2*d*x+1/2*c)+ 1)*cos(d*x+c)+28*((5/14*A+1/28*C)*cos(2*d*x+2*c)+(A+1/7*C)*cos(d*x+c)+4/7* A+1/28*C)*tan(1/2*d*x+1/2*c)*sec(1/2*d*x+1/2*c)^2)/d/a^2/cos(d*x+c)
Time = 0.27 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.84 \[ \int \frac {\left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx=-\frac {3 \, {\left (A \cos \left (d x + c\right )^{3} + 2 \, A \cos \left (d x + c\right )^{2} + A \cos \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (A \cos \left (d x + c\right )^{3} + 2 \, A \cos \left (d x + c\right )^{2} + A \cos \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - {\left ({\left (10 \, A + C\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (7 \, A + C\right )} \cos \left (d x + c\right ) + 3 \, A\right )} \sin \left (d x + c\right )}{3 \, {\left (a^{2} d \cos \left (d x + c\right )^{3} + 2 \, a^{2} d \cos \left (d x + c\right )^{2} + a^{2} d \cos \left (d x + c\right )\right )}} \]
-1/3*(3*(A*cos(d*x + c)^3 + 2*A*cos(d*x + c)^2 + A*cos(d*x + c))*log(sin(d *x + c) + 1) - 3*(A*cos(d*x + c)^3 + 2*A*cos(d*x + c)^2 + A*cos(d*x + c))* log(-sin(d*x + c) + 1) - ((10*A + C)*cos(d*x + c)^2 + 2*(7*A + C)*cos(d*x + c) + 3*A)*sin(d*x + c))/(a^2*d*cos(d*x + c)^3 + 2*a^2*d*cos(d*x + c)^2 + a^2*d*cos(d*x + c))
\[ \int \frac {\left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx=\frac {\int \frac {A \sec ^{2}{\left (c + d x \right )}}{\cos ^{2}{\left (c + d x \right )} + 2 \cos {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\cos ^{2}{\left (c + d x \right )} + 2 \cos {\left (c + d x \right )} + 1}\, dx}{a^{2}} \]
(Integral(A*sec(c + d*x)**2/(cos(c + d*x)**2 + 2*cos(c + d*x) + 1), x) + I ntegral(C*cos(c + d*x)**2*sec(c + d*x)**2/(cos(c + d*x)**2 + 2*cos(c + d*x ) + 1), x))/a**2
Leaf count of result is larger than twice the leaf count of optimal. 191 vs. \(2 (87) = 174\).
Time = 0.26 (sec) , antiderivative size = 191, normalized size of antiderivative = 2.10 \[ \int \frac {\left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx=\frac {A {\left (\frac {\frac {15 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {12 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a^{2}} + \frac {12 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a^{2}} + \frac {12 \, \sin \left (d x + c\right )}{{\left (a^{2} - \frac {a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} + \frac {C {\left (\frac {3 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{2}}}{6 \, d} \]
1/6*(A*((15*sin(d*x + c)/(cos(d*x + c) + 1) + sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/a^2 - 12*log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a^2 + 12*log(si n(d*x + c)/(cos(d*x + c) + 1) - 1)/a^2 + 12*sin(d*x + c)/((a^2 - a^2*sin(d *x + c)^2/(cos(d*x + c) + 1)^2)*(cos(d*x + c) + 1))) + C*(3*sin(d*x + c)/( cos(d*x + c) + 1) + sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/a^2)/d
Time = 0.30 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.56 \[ \int \frac {\left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx=-\frac {\frac {12 \, A \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a^{2}} - \frac {12 \, A \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a^{2}} + \frac {12 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} a^{2}} - \frac {A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 15 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6}}}{6 \, d} \]
-1/6*(12*A*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a^2 - 12*A*log(abs(tan(1/2*d *x + 1/2*c) - 1))/a^2 + 12*A*tan(1/2*d*x + 1/2*c)/((tan(1/2*d*x + 1/2*c)^2 - 1)*a^2) - (A*a^4*tan(1/2*d*x + 1/2*c)^3 + C*a^4*tan(1/2*d*x + 1/2*c)^3 + 15*A*a^4*tan(1/2*d*x + 1/2*c) + 3*C*a^4*tan(1/2*d*x + 1/2*c))/a^6)/d
Time = 1.21 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.24 \[ \int \frac {\left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx=\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {A+C}{a^2}+\frac {3\,A-C}{2\,a^2}\right )}{d}-\frac {4\,A\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^2\,d}-\frac {2\,A\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-a^2\right )}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (A+C\right )}{6\,a^2\,d} \]